package com.eddie.command;

/**
 * @author Eddie
 * @date 2022/08/03 13:47
 **/
public class LightOffCommand implements Command {
    /**
     * 聚合LightReceiver
     */
    private final LightReceiver light;

    public LightOffCommand(LightReceiver light) {
        this.light = light;
    }

    @Override
    public void execute() {
        //调用接收者的方法
        light.off();
    }

    @Override
    public void undo() {
        light.on();
    }
}
